using MediatR;
using B.S.RbacData.ErrorCode;
using System.ComponentModel.DataAnnotations;

namespace SupplierCustomerManagement.Write.API.Applications.Commands.suppliercontacts
{
    /// <summary>
    /// 添加供应商联系人命令
    /// </summary>
    public class AddSupplierContactCommand : IRequest<ApiResult<int>>
    {
        /// <summary>
        /// 供应商ID
        /// </summary>
        [Required(ErrorMessage = "供应商ID不能为空")]
        public int SupplierId { get; set; }

        /// <summary>
        /// 联系人姓名
        /// </summary>
        [Required(ErrorMessage = "联系人姓名不能为空")]
        [StringLength(100, ErrorMessage = "联系人姓名长度不能超过100个字符")]
        public string ContactPerson { get; set; } = string.Empty;

        /// <summary>
        /// 职务
        /// </summary>
        [StringLength(100, ErrorMessage = "职务长度不能超过100个字符")]
        public string? Position { get; set; }

        /// <summary>
        /// 省份
        /// </summary>
        [StringLength(50, ErrorMessage = "省份长度不能超过50个字符")]
        public string? Province { get; set; }

        /// <summary>
        /// 城市
        /// </summary>
        [StringLength(50, ErrorMessage = "城市长度不能超过50个字符")]
        public string? City { get; set; }

        /// <summary>
        /// 区县
        /// </summary>
        [StringLength(50, ErrorMessage = "区县长度不能超过50个字符")]
        public string? District { get; set; }

        /// <summary>
        /// 详细地址
        /// </summary>
        [StringLength(500, ErrorMessage = "详细地址长度不能超过500个字符")]
        public string? DetailedAddress { get; set; }

        /// <summary>
        /// 电话
        /// </summary>
        [StringLength(50, ErrorMessage = "电话长度不能超过50个字符")]
        public string? Phone { get; set; }

        /// <summary>
        /// 手机号码
        /// </summary>
        [StringLength(20, ErrorMessage = "手机号码长度不能超过20个字符")]
        public string? MobilePhone { get; set; }

        /// <summary>
        /// 邮编
        /// </summary>
        [StringLength(10, ErrorMessage = "邮编长度不能超过10个字符")]
        public string? PostalCode { get; set; }

        /// <summary>
        /// 邮箱
        /// </summary>
        [StringLength(100, ErrorMessage = "邮箱长度不能超过100个字符")]
        [EmailAddress(ErrorMessage = "邮箱格式不正确")]
        public string? Email { get; set; }

        /// <summary>
        /// 是否为默认联系人
        /// </summary>
        public bool IsDefault { get; set; } = false;

        /// <summary>
        /// 创建人ID
        /// </summary>
        public int? CreatedBy { get; set; }
    }
} 